//
// Created by 86155 on 2025/4/15.
//

#ifndef LLVM_FEINSTRINFO_H
#define LLVM_FEINSTRINFO_H

#include "llvm/CodeGen/TargetInstrInfo.h"

#define GET_INSTRINFO_HEADER
#include "FeGenInstrInfo.inc"

namespace llvm {
class FeInstrInfo : public FeGenInstrInfo{
public:
  explicit FeInstrInfo();

  /// 处理callee
  void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex,
                           const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const override;
  void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex,
                            const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const override;

  void copyPhysReg(MachineBasicBlock &MBB,
                           MachineBasicBlock::iterator MI, const DebugLoc &DL,
                           MCRegister DestReg, MCRegister SrcReg,
                           bool KillSrc) const override;
};
}
#endif // LLVM_FEINSTRINFO_H
